package com.fourth.service.impl;

import com.fourth.dao.UbGoodsDao;
import com.fourth.service.UbGoodsService;
import com.ljx.entity.Goods;
import com.ljx.entity.Stock;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @author Mr.ma
 * @since 2023/3/2 17:14
 **/
@Service
public class UbGoodsServiceImpl implements UbGoodsService {
    @Resource
    private UbGoodsDao ubGoodsDao;

    @Override
    public Goods findById(Integer id) {
        return ubGoodsDao.findById(id);
    }

    @Override
    public String getGoodsSellNum(Integer id) {
        Stock stock = ubGoodsDao.getStock(id);
        return stock.getSellNum();
    }

    @Override
    public String getStock(Integer id) {
        Stock stock = ubGoodsDao.getStock(id);
        return stock.getResidue();
    }
}
